home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
public
/
Xprof
/
xmeasure
/
perf.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
4KB
|
118 lines
/*==================================================================
* File : perf.h
* Package: Xmeasure
*
* Author : Aloke Gupta.
*
* (C) Copyright 1992, Aloke Gupta.
* All rights granted to University of Illinois Board of Regents.
*==================================================================*/
#ifndef _PROFILE_H_
#define _PROFILE_H_
#include <stdio.h>
#include <ctype.h>
#include <string.h>
/*
#include <stdlib.h>
*/
#include <values.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
double gettime(); /* Defined in timer.c */
double getabstime(); /* Defined in timer.c */
double TimeSpent(); /* Defined in timer.c */
double median(); /* Defined in main.c */
#define DISPHEIGHT 600
#define DISPWIDTH 600
#define MSGHEIGHT 20
/* Center the display on the screen */
/*
#define XPOSITION(d,s) ((DisplayWidth (d,s) - DISPWIDTH )/ 2)
#define YPOSITION(d,s) ((DisplayHeight(d,s) - DISPHEIGHT)/ 2)
*/
#define XPOSITION(d,s) ((DisplayWidth (d,s) - DISPWIDTH ) - 16)
#define YPOSITION(d,s) ((DisplayHeight(d,s) - DISPHEIGHT) - 5)
/* Maximum number of request types in the X protocol */
#define MAXREQUESTS 128
/*
*The following macros are written for handling the various combinations of
* parameters for graphics operations
*/
#define NUMGXMODES 2
#define NUMLINESTYLES 2
#define NUMFILLSTYLES 2
#define NUMLINEWIDTHS 4
#define MASK2 0x01
#define MASK4 0x03
#define GFXSLOTS (NUMGXMODES * NUMLINESTYLES * NUMFILLSTYLES * NUMLINEWIDTHS)
#define GFXINDEX(gxmode, linestyle, fillstyle, linewidth) ( \
((gxmode & MASK2) ) | \
((linestyle & MASK2) << 1) | \
((fillstyle & MASK2) << 2) | \
((linewidth & MASK4) << 3) )
typedef struct _XD { /* Some parameters about the display server */
Display *display;
char *displayname;
int screen;
Visual *visual; /* Default visual */
Colormap cmap; /* Default color map */
Window window; /* Main window */
Window msgwindow; /* Window for printing messages */
GC gc, msggc; /* GC's for the main and message windows */
GC gcarray[GFXSLOTS]; /* GC's for each type of graphics operation */
unsigned long foreground;
unsigned long background;
char *fgname;
char *bgname;
int sstimeout, ssinterval, sspb, ssae; /* Screen saver preferences */
} XD;
typedef enum {
TRUE = 1, FALSE = 0
} Boolean;
#define INVALID -1 /* Marks invalid sizes in the sizepair[] array */
#define MAXSIZEPAIRS 5
typedef struct _SizePair {
int s1;
int s2;
} SizePair;
typedef enum {
GFX, WIN, TXT
} MsgClass;
typedef struct _TestRequest {
int number; /* Xlib number for this message */
char *name; /* Symbolic name for this message */
MsgClass msgclass; /* Is this a windowing or a graphics message?*/
Boolean dothis; /* Should xperf run this test ? */
int (*init) (); /* Initialization procedure for test */
int (*func) (); /* Actual test */
int (*cleanup)(); /* Cleanup procedure after the test */
SizePair sizepair[MAXSIZEPAIRS]; /* Size of data for test procedure */
} TestRequest;
typedef struct _XParams { /* Parameters passed to the test functions */
GC gc; /* Graphics context for this computation */
long itns; /* No. of iterations. Set by Calibrate() */
SizePair *sizepair; /* Size pair for this computation */
long size; /* Single number for size. Set by i_func() */
long numobjs; /* Number of objects processed in one call. */
/* Set by i_func() */
} XParams;
#endif /* #ifndef _PROFILE_H_ */